namespace MasterNeverDown.EverythingIOT.Model
{
    public class ModbusSubscription
    {
        public string Host { get; set; }
        public int Port { get; set; }
        public byte SlaveId { get; set; }
        public ushort StartAddress { get; set; }
        public ushort NumRegisters { get; set; }
        
        public long LastUpdated { get; set; }

        public ModbusSubscription(){}
        public ModbusSubscription(string host, int port, byte slaveId, ushort startAddress, ushort numRegisters)
        {
            Host = host;
            Port = port;
            SlaveId = slaveId;
            StartAddress = startAddress;
            NumRegisters = numRegisters;
        }

        public override string ToString()
        {
            return $"{Host}_{Port}_{SlaveId}_{StartAddress}";
        }
    }
}